<?php
/**
 * User: hjd-yao
 * Date: 2019/4/19
 * Time: 17:42
 */

namespace App\Http\Controllers\Shop\Traits;


use App\Models\Shop\ShopGoodsBillModel;
use App\Models\Shop\ShopGoodsModel;
use App\Models\Shop\ShopGoodsSpecialModel;
use Illuminate\Http\Request;

trait GoodsTrait
{


    /**
     * @title 编辑商品价格
     * @param ShopGoodsModel $goods
     * @return View
     */
    private function editPrice(ShopGoodsModel $goods)
    {
        $goods_name = $goods->goods_name;
        $goods = ShopGoodsBillModel::find($goods->goods_id);
        return view('backend::shop.goods.special_needs.goods_price',[
            'page_title'=>'修改'.$goods_name.'价格',
            'goods'=>$goods
        ]);
    }


    private function info(ShopGoodsModel $goods)
    {
        if($goods->goods_zone == 2){
            $goods->bill = ShopGoodsBillModel::find($goods->goods_id);
        }
        return $goods;
    }
}